import com.dbpms.config.SpringConfig;
import com.dbpms.pojo.StudentInfo;
import com.dbpms.service.IUserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = SpringConfig.class)
public class userTest {

    @Autowired
    private IUserService service;

    @Test
    public void testUpdatePWD(){

        int pd = service.updatePwd("1223","1111",2);
        System.out.println(" pd : "+pd);

    }

    /**
     * 判定学号是否存在
     */
    @Test
    public void testIfExit(){

        StudentInfo info = service.ifExitUser("17354125");
        System.out.println(" info : "+info);

    }
    /**
     * 注册
     */
    @Test
    public void register(){

        int in = service.addRegisterUser(34,"张三5","ad513min","212");
        System.out.println(" in : "+in);

    }
}
